/**
 * @(#)PersonServiceImpl.java, 2019/1/4
 * <p/>
 * Copyright 2019 Netease, Inc. All rights reserved.
 * NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.chengzhi.netty.thrift;

import org.apache.thrift.TException;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * @author 阮承志(wb.ruanchengzhi @ mesg.corp.netease.com)
 **/
public class PersonServiceImpl implements PersonService.Iface {

    @Override
    public Person getPersonByName(String name) throws DataInfoException, TException {
        System.out.println("getPersonByName: " + name);
        Person person = new Person();
        person.setName(name);
        person.setAge(22);
        person.setSex(false);
        person.setStus(new ArrayList<>());
        person.setMaps((Map<String, String>) new HashMap<>().put("aa", "bb"));
        return person;
    }

    @Override
    public void savePerson(Person person) throws DataInfoException, TException {
        System.out.println(person.toString());
    }
}
